
TARGET_EX_NM := example.so

TARGET_NM := lfs.so
TARGET_DIR = ../test
TARGET := $(TARGET_DIR)/$(TARGET_NM)

TARGET_EX := $(TARGET_DIR)/$(TARGET_EX_NM)

OBJS := $(patsubst %.cpp,%.o, lfs.cpp)  

EX_OBJS := $(patsubst %.cpp,%.o, demo.cpp example.cpp) \

CXXFLAGS += -I/usr/include/python3.12/ \
            -fPIC -g

LDFLAGS += -O3 -Wall -shared

CXXFLAGS += -std=c++11

LDLIBS += -L.. -llfs

all: lfs $(TARGET) $(TARGET_EX)

lfs:  .FORCE
	$(MAKE) -C .. -f Makefile.lfs
lfs_clean:
	$(MAKE) -C .. -f Makefile.lfs clean

$(TARGET): $(OBJS)
	$(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS)

$(TARGET_EX): $(EX_OBJS)
	$(CXX) $(LDFLAGS)  -o $@ $^

clean: lfs_clean
	$(RM) $(TARGET) $(OBJS) $(TARGET_EX) $(EX_OBJS)

.FORCE:
